import java.util.*;

public class _05_CountAllWords {
	
	public static void main(String[] args) {
		
		Scanner in = new Scanner(System.in);
		String input = in.nextLine();
		in.close();
		
		String[] splittedText = input.split("\\W");
		List<String> list = new ArrayList<String>(Arrays.asList(splittedText));
		//list.removeAll(Arrays.asList("", null));
	    list.removeAll(Collections.singleton(""));
		System.out.println(list.size());
	}
}